﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;

namespace LG.DB
{
    public static class DBConvHelper
    {
        public static List<T> ReaderToList<T>(DbDataReader reader, Func<DbDataReader, T> toModel)
        {
            List<T> list = new List<T>();
            while (reader.Read())
            {
                T model = toModel(reader);
                list.Add(model);
            }
            return list;
        }
    }
}
